<form action="#" class="form-horizontal" name="test" data-ng-controller="comboCtrl">
    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">通用下拉菜单</label>

            <div class="col-md-4">
                <div ed-combo="combo" data-options="panelWidth: 300">
                    <div>
                        <span>自定义下拉内容</span>
                        <button type="button" class="btn" ng-click="combo.setText('text');">设置值</button>
                        <button type="button" class="btn" ng-click="combo.hide();">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <hr/>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">下拉单选</label>

            <div class="col-md-4">
                <select class="form-control" ed-combobox ng-model="deptId"
                        data-options="idField: 'deptId', textField: 'deptName', url: 'department/tree.do'"></select>
            </div>
            <label class="col-md-2 control-label"><s>过时</s></label>

            <div class="col-md-4">
                <select class="form-control" ed-combobox ed-key="deptId,deptName" ed-url="department/tree.do"
                        ng-model="deptId"></select>
            </div>
        </div>
    </div>

    <hr/>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">单选下拉树{{dept}}</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do'"
                     ng-model="dept" placeholder="请选择"></div>
            </div>

            <div class="col-md-6">
                <button type="button" class="btn green" ng-click="dept='10'"><i class="fa fa-save"></i> id赋值</button>
                <button type="button" class="btn green" ng-click="dept={deptId: '10'}"><i class="fa fa-save"></i> json赋值</button>
                <button type="button" class="btn green" ng-click="dept=''"><i class="fa fa-save"></i> 清空</button>
            </div>
        </div>
    </div>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">多选下拉树{{dept1}}</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do', multiple: true"
                     ng-model="dept1" placeholder="请选择"></div>
            </div>

            <div class="col-md-6">
                <button type="button" class="btn green" ng-click="dept1='1, 10'"><i class="fa fa-save"></i> id赋值</button>
                <button type="button" class="btn green" ng-click="dept1=[{deptId: '1'}, {deptId: '10'}]"><i class="fa fa-save"></i> json赋值</button>
                <button type="button" class="btn green" ng-click="dept1=''"><i class="fa fa-save"></i> 清空</button>
            </div>
        </div>
    </div>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">单选返回id{{a.deptId}}</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do'"
                     ng-model="a.deptId" placeholder="请选择"></div>
            </div>

            <label class="col-md-2 control-label">多选返回id{{b.parentDeptId}}</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do', multiple: true"
                     ng-model="b.parentDeptId" placeholder="请选择"></div>
            </div>
        </div>
    </div>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">下拉项外部赋值</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId'"
                     ed-data="data" ng-model="dept2" placeholder="请选择"></div>
            </div>
        </div>
    </div>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">deptId为5的不允许选择</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do'"
                     ed-selectable="selectable(data)" ng-model="dept3" placeholder="请选择"></div>
            </div>

            <label class="col-md-2 control-label">多选</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do', multiple: true"
                     ed-selectable="selectable(data)" ng-model="dept4" placeholder="请选择"></div>
            </div>
        </div>
    </div>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">勾选时不级联选择</label>

            <div class="col-md-4">
                <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do', multiple: true, original: {check:{chkStyle: 'checkbox', chkboxType: {'Y': '', 'N': '' }}}"
                     ng-model="dept5" placeholder="请选择"></div>
            </div>
        </div>
    </div>

    <hr/>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-2 control-label">下拉表格{{userId}}</label>

            <div class="col-md-4">
                <div ed-combogrid="userCombogrid" ng-model="userId" data-options="
                        panelWidth: 500,
                        idField: 'userId',
                        textField: 'userName',
                        url: 'user/query.do',
                        data: {
                            id: '1'
                        },
                        columns: [[
                            {col:'userCode',name:'用户名',width:120},
                            {col:'userName',name:'用户姓名',width:80,align:'right'},
                            {col:'gender | code : gender',name:'性别',width:80,align:'right'},
                            {col:'telephone',name:'手机号码',width:200}
                        ]]
                    ">
                    <div class="param">
                        <label class="control-label">姓名</label>
                        <input type="text" class="form-control" ng-model="codeOrName">
                        <label class="control-label">所属部门</label>
                        <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do', panelWidth: 350"
                             ng-model="deptId" placeholder="请选择"></div>
                    </div>
                </div>
            </div>
            <div class="col-md-2">
                <button type="button" class="btn green" ng-click="userId='92'"><i class="fa fa-save"></i> 赋值</button>
            </div>
        </div>
    </div>

    <hr/>

    <div class="form-body">
        <div class="form-group">
            <label class="col-md-3 control-label">弹出框里使用</label>

            <div class="col-md-8">
                <button type="button" class="btn green" ng-click="modal.setTitle('弹出框下拉树1').show()"><i class="fa fa-save"></i> 弹出</button>
                <div ed-modal="modal" data-options="title: '弹出框下拉树', icon: 'fa-plus', width: 260">
                    <div class="form-horizontal">
                        <div class="form-body">
                            <div class="form-group">
                                <label class="col-md-3 control-label">部门{{dept10}}</label>

                                <div class="col-md-9">
                                    <div ed-combotree data-options="idField: 'deptId', textField: 'deptName', parentIdField: 'parentDeptId', url: 'department/tree.do', panelWidth: 350"
                                         ng-model="dept10" placeholder="请选择部门"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</form>
<script>

    function comboCtrl($scope, Page) {

        Page.ajaxGet('department/tree.do', null, function(resp) {
            $scope.data = resp.data;
        });

        $scope.selectable = function(data) {
            return data.deptId != '5';
        }
    }

</script>